@extends('admin.layout')
@section('content')
       <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                订单管理
                <small>列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 后台</a></li>
                <li><a href="#">订单管理</a></li>
                <li class="active">列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">快速查看订单列表</h3>
                        </div><!-- /.box-header -->
                                    
                      
                        <div class="box-body" >

                            @if(session('info'))
                             <div id='tishixiaoshi' class="alert alert-success alert-dismissable">
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h4><i class="icon fa fa-check"></i> 提示!</h4>
                             {{ session('info')}}
                        </div>
                            @endif
                             <script type="text/javascript">
                              window.onload = function()
                              {
                                $('#tishixiaoshi').hide(3000);
                              }
                            </script>
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th> 订单ID</th>
                                    <th>用户名</th>
                                    <th>手机号</th>
                                    <th>地址</th>
                                    <th>商品</th>
                                    <th>状态</th>
                                    <th>订单时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                           
                                   @foreach($data as $user)
                                <tr>
                                    <td>{{ $user -> iid}}</td>
                                    <td>{{ $user -> userName}}
                                    </td>
                                    <td>{{ $user -> phone}}</td>
                                    <td>{{ $user -> site}}</td>
                                    <td>{{ $user -> name}}</td>
                                    <td><a>
                                    	@if($user->pay==0)
                                    	   未付款 |
                                    	@else
                                    	  已付款 |
                                    	@endif
                                    	</a>
                                      <a>
                                      @if($user->pass==0)
                                         未发货 |
                                      @else
                                        已发货 |
                                      @endif
                                      </a>
                                         <a>
                                      @if($user->sign==0)
                                         未签收 
                                      @else
                                        已签收
                                      @endif
                                      </a>
                                    </td>
                                    <td>
                                      {{ $user -> time}}
                                    </td>
                                    <td>
                                        @if($user -> pay == 1 && $user -> pass == 0 )
                                     <a href="{{url('/admin/indent/pass')}}/{{$user -> iid}}">
                                        发货 
                                      </a> 
                                        @endif

                                       @if($user -> pay == 1 && $user -> pass == 1 && $user -> sign == 0)
                                       <a href="{{url('/admin/indent/unpass')}}/{{$user -> iid}}">
                                        取消发货 | 
                                       </a> 
                                        @endif

                                        @if($user -> pay ==1 && $user -> pass ==1 &&$user -> sign == 0)
                                         <a href="{{url('/admin/indent/sign')}}/{{$user -> iid}}">签收</a>
                                        @endif 

                                         @if($user -> pay ==1 && $user -> pass ==1 &&$user -> sign == 1)
                                         <a href="{{url('/admin/indent/unsign')}}/{{$user -> iid}}">取消签收</a>
                                        @endif 
                                    </td>
                                </tr>
                                 @endforeach
                  
                            </table>
                           

                              
                                
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->

    </div><!-- /.content-wrapper -->
    
    <!-- 分页-->

                        
@endsection